<?php
class category_Model_Relations extends Clu_Db_Table_Abstract
{	
    //only specify the table name, everything else inherits
	protected $_name = "category_relations";
//	protected $_name =$this->m->_relation_name;
	protected $_primary = array("id","pid");
	
	public function setupTableName($relation_name)
	{
		$this->_name = $relation_name;
	}
	
	/**
	 * Implements Clu_Db_Table_Abstract
	 */
	public function findByPrimary($r)
	{
		$id = $r['id'];
		$pid = $r['pid'];
		
		if (!$id || !$lang)
			return null;
		else
			return $this->fetchRow('id = ' . $this->getAdapter()->quote($id, 'INTEGER') .
			 						' AND pid = ' . $this->getAdapter()->quote($pid, 'STRING'));     
		
	}
}
?>